//
//  CollectionTableViewCell.m
//  UI_Project_A
//
//  Created by GH on 16/3/3.
//  Copyright © 2016年 GH. All rights reserved.
//

#import "CollectionTableViewCell.h"


#define WIDTH self.frame.size.width
#define HEIGHT  self.frame.size.height


@interface CollectionTableViewCell ()




@end

@implementation CollectionTableViewCell


- (void)dealloc {
    
   
    [_label release];
    [_imageviewInt release];
    [_labelTime release];
    [super dealloc];
}



- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {


    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        [self createLabel];
        [self createImageview];
        
    }

    return self;
}

#pragma mark - label
- (void)createLabel {
    
    self.label = [[UILabel alloc]init];
    self.label.numberOfLines = 0;
    [self addSubview:self.label];
    [self.label release];
    
    
    
    // Timelabel
    
    self.labelTime = [[UILabel alloc] init];
    self.labelTime.numberOfLines = 0;
    [self addSubview:self.labelTime];
    [self.labelTime release];
    
    
  
}


- (void)createImageview {
    self.imageviewInt = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@""]];
    
    [self addSubview:self.imageviewInt];
    [self.imageviewInt release];
    
       
}


- (void)layoutSubviews {
    [super layoutSubviews];
    
    
 self.label.frame = CGRectMake(20, 10, WIDTH/3 * 2 - 25, self.frame.size.height/2);  
    self.imageviewInt.frame = CGRectMake(WIDTH * 2/3, 10, WIDTH/3-10, HEIGHT - 10);
    self.labelTime.frame = CGRectMake(45, HEIGHT/5 * 3.5, 100, 30);
    
   
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
